﻿namespace Acl.Messages;

/// <summary>
/// 分布式通知处理器
/// </summary>
public abstract class DistributionNotificationHandler<TData> : IDistributionNotificationHandler<TData>
{
    /// <summary>
    /// 
    /// </summary>
    public abstract DistributionSubscribeOptions? Options { get; }


    Task IDistributionNotificationHandler<TData>.Handle(IDistributionMessage<TData> msg, CancellationToken? cancellationToken)
    {
        Handle(msg);
        return Task.CompletedTask;
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="msg"></param>
    protected abstract void Handle(IDistributionMessage<TData> msg);
}